package com.ruoyi.web.controller.websocket;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;

/**
 * @description:
 * @author: Sunhongchen
 * @date: 2021-11-26
 */
@RestController
public class DemoController {
    @Autowired
    private WsServerEndpoint wsServerEndpoint;

    @GetMapping("/push")
    public void pushToWeb(String message) throws IOException {
        wsServerEndpoint.sendMessage(message);
    }
}
